<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
	<title>
	<?php if(!empty($pagetitle)): echo ($pagetitle); endif; ?>
</title>
<script type="text/javascript" src="__ROOT__/public/jsLib/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="__ROOT__/public/jsLib/jquery.cookies.2.2.0.min.js"></script>
<script type="text/javascript" src="__ROOT__/asset/js/main.js"></script>
<script type="text/javascript" src="__ROOT__/asset/js/checkfield.js"></script>
<link rel="stylesheet" type="text/css" href="__ROOT__/public/jsLib/bootstrap/css/bootstrap.css" />
<link rel="stylesheet" type="text/css" href="__ROOT__/public/jsLib/bootstrap/google-code-prettify/prettify.css" />
<link rel="stylesheet" type="text/css" href="__ROOT__/asset/main.css" />
<script type="text/javascript" src="__ROOT__/public/jsLib/bootstrap/bootstrap.min.js"></script>
<script type="text/javascript" src="__ROOT__/public/jsLib/bootstrap/google-code-prettify/prettify.js"></script>
<script type="text/javascript">
	var APP = "__APP__";
	var cookie_prefix = '<?php echo ($cookie_prefix); ?>';
	var app_path = $.cookies.get(cookie_prefix+'config_path');
	var dir = $.cookies.get(cookie_prefix+'base_dir');
	var app_name = $.cookies.get(cookie_prefix+'app_name');
	var version = $.cookies.get(cookie_prefix+'version');
	var app_url=$.cookies.get(cookie_prefix+'app_url');
	$(function () {
		//首页的tooltip绑定
		$('.leftbar>li').tooltip({placement:'right'});
		prettyPrint()
	});
</script>
</head>
<body>
<div class="navbar navbar-fixed-top navbar-inverse">
	<div class="navbar-inner">
		<div class="container">
			<a class="brand" href="__APP__" data-original-title="返回TP助手首页">ThinkPHP助手</a>
			<ul class="nav">
				<li class="divider-vertical"></li>

				<li><a href="" class="app_name" data-original-title="访问项目首页" style="color: #ffffff;font-weight: bold;" target="_blank"></a></li>
			</ul>

			<form class="pull-right" id="docform" action="" method="post" enctype="application/x-www-form-urlencoded" target="_blank">
				<div class="input-prepend input-append">
					<select name="docname" id="docname" class="" onchange="getAction()">
						<option value="php">php</option>
						<option value="jquery">jQuery</option>
						<option value="thinkphp">ThinkPHP</option>
					</select>
					<input name="pattern" class="span2" id="appendedInputButtons" type="text" onchange="getAction()" placeholder="输入函数名或关键词">
					<input type="hidden" name="keywords" value="">
					<input type="hidden" name="show" value="quickref">
					<input type="hidden" name="lang" value="zh">
					<button class="btn" type="submit">搜索</button>
				</div>
			</form>

		</div>
	</div>
</div>

<div class="top-alert alert-error affix" style="display: none;">
	<div class="container ">
		<button class="close" style="margin-top: 4px;">&times;</button>
		<div class="alert alert-error alert-noborder alert-content" style="">
			表单填写有误,请检查红色提示表单项.
		</div>
	</div>
</div>

<script type="text/javascript">
	$('.navbar .app_name').text("当前项目：" + app_name);
	$('.navbar .app_name').attr('href', app_url);
	$('.navbar a').tooltip({placement:'bottom'});
	var search = {
		php     :"http://cn2.php.net/search.php",
		jquery  :'http://api.jquery.com/?ns0=1&s=keywords',
		thinkphp:'http://doc.thinkphp.cn/manual/_search.html'
	}
	function getAction() {
		var keyword = $("input[name='pattern']").val();
		var url = search[$('#docname').val()].replace(/keywords/, keyword);
		$('#docform').attr('action', url);
		$("input[name='keywords']").val(keyword)
	}
	getAction();
</script>
<div class="container content">
	<div class="row">
		<div class="span3 body-content">
			<ul class="nav nav-tabs nav-stacked leftbar">
	<li id="config_list" data-original-title="修改当前项目的配置文件">
		<a href="__APP__/Config/index">
			编辑项目配置
			<i class="icon-chevron-right"></i>
		</a>
	</li>
	<li data-original-title="快速向项目中添加常用js库">
		<a href="__APP__/FileManager/getfilelist" id="addlib" class="showform" data-original-title="添加js或css框架到项目目录">添加前端库
		<i class="icon-chevron-right"></i>
		</a>
	</li>
	<li>
		<a href="__APP__/Index/pregTest" id="pcrehelper" class="showform" data-original-title="正则表达式测试">PHP正则助手
		<i class="icon-chevron-right"></i>
		</a>
	</li>
	<li>
		<a href="__APP__/Index/fragmentTest">代码片段测试
		<i class="icon-chevron-right"></i>
		</a>
	</li>
	<li>
		<a href="__APP__/Index/installConsole">安装Console工具
			<i class="icon-chevron-right"></i>
		</a>
	</li>
	<li>
		<a href="__APP__/Index/markdown">Markdown编辑器
			<i class="icon-chevron-right"></i>
		</a>
	</li>
</ul>
<script type="text/javascript">
	$.each($('.leftbar li'),function(){
		if (location.href.indexOf($(this).find('a').attr('href'))>0 ) {
			$(this).addClass('active')
		}
	})
</script>
		</div>
		<div class="span9">
			<div class="body-content index-content">
				<ul class="nav nav-tabs project-tab">
					<li class="active"><a href="#summary" data-toggle="tab">环境信息</a></li>
					<li><a href="#form_createapp" data-toggle="tab">创建项目</a></li>
					<li><a href="#form_addapp" data-toggle="tab">添加项目</a></li>
					<li><a href="#listapp" data-toggle="tab">项目列表</a></li>
				</ul>
				<div class="tab-content">
					<?php echo ($createapp); ?>
					<?php echo ($addapp); ?>
					<?php echo ($listapp); ?>
					<?php echo ($summary); ?>
				</div>
			</div>
			<script type="text/javascript">
				$(function () {
					$('.tab-content').find('input,label').tooltip({placement:'right'});
					$('.project-tab a').on('click', function () {
						if ($('.top-alert').hasClass('block')) {
							$('.top-alert').removeClass('block').slideUp(200);
							$('.content').animate({marginTop:'-=36'}, 200);
						}
					});
				});
			</script>
		</div>
	</div>
</div>
<?php echo ($footer); ?>
</body>
</html>